from z_web.models import MovieNew, Movie

def create_map():
    url_list = []
    base_url = "https://www.dwang.top"
    urls = [base_url, base_url + "/list", base_url + "/news", base_url + "/links"]
    for i in Movie.objects.all().values_list("id", flat=True):
        urls.append(base_url+ "/eval/{}/".format(i))
        urls.append(base_url + "/movie/{}/".format(i))

    for i in MovieNew.objects.all().values_list("id", flat=True):
        urls.append(base_url+ "/n/{}/".format(i))

    with open("/server/z_movie/site_map.txt", "w") as f:
        f.write("\n".join(urls))
